package com.llgz.hotelmanageapi.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.llgz.hotelmanageapi.pojo.DO.OrderInfo;
import com.llgz.hotelmanageapi.mapper.OrderInfoMapper;
import com.llgz.hotelmanageapi.service.OrderInfoServer;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 订房信息表 服务实现类
 * </p>
 *
 * @author Bernie_fang
 * @since 2021-07-19
 */
@Service
public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo> implements OrderInfoServer {

    @Autowired
    OrderInfoMapper orderInfoMapper;
    @Override
    public Integer updateOrderStatusById(String id,Integer status) {
        UpdateWrapper<OrderInfo> orderInfoUpdateWrapper = new UpdateWrapper<>();
        orderInfoUpdateWrapper.eq("id",id);
        orderInfoUpdateWrapper.set("order_status",status);
        return orderInfoMapper.update(null,orderInfoUpdateWrapper);

    }
}
